import React, { useRef, useContext, useEffect } from 'react';

function UseRef() {
    const btnRef = useRef(null)

    useEffect( () => {
      console.log(btnRef.current)
    })
    return <div>
      <p ref={btnRef}>useRef</p>
    </div>;
}
const nameDesc = 'Jerry'
const ThemeContext =  React.createContext(nameDesc);

function Do() {
  const name = useContext(ThemeContext)
  return <p>
    她的名字 为：{name}
  </p>
}
function List() {
  return <Do></Do>
}

function  App() {

  return <ThemeContext.Provider value={nameDesc}>
    <List/>
  </ThemeContext.Provider>
}
export default App